Dynomotion

Group: DynoMotion Message: 5790 From: stephen_lamarr Date: 10/12/2012
Subject: Stepper Homing using Kflop andYaskawa Junma servos
I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.


#include "KMotionDef.h"

// Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

#define XHOME 168
#define YHOME 169
#define ZHOME 170
void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);

main()
{
persist.UserData[10] = 0;
DoHome( 1, // X
30000, // speed steps/sec
1, // direction to home
0, // home input bit
1, // bit polarity (0 or 1) when tripped
1000); // amount to move back inside (counts)

}
void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
{
float oppdir = dir * -1;

EnableAxis(axis);
if(ReadBit(bit)==polarity)
{
Jog(axis, speed * oppdir); // start moving
while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
Jog(axis,0); // stop
MoveRelAtVel(axis,sensoroffset * oppdir,speed);
while(!CheckDone(0));
}

Jog(axis, speed * dir); // start moving
//printf("%d \n",persist.UserData[10]);
while (ReadBit(bit) != polarity)
{
persist.UserData[10] = 0;

// send message to console
} // wait for switch (input #44) to change
if(ReadBit(bit)== polarity)
{
persist.UserData[10] = 1; // Signal MM that homing has completed
//printf("%d \n",persist.UserData[10]);
}
Jog(axis,0); // stop
while(!CheckDone(0));

MoveRelAtVel(axis,sensoroffset * oppdir,speed);
Zero(0);
//EnableAxisDest(axis,0);
}
Group: DynoMotion Message: 5791 From: TK Date: 10/12/2012
Subject: Re: Stepper Homing using Kflop andYaskawa Junma servos
Hi Stephen,

I see some CheckDone and Zero function calls that are passing axis 0 rather than the axis variable which is 1. Try correcting those. 

Regards

TK

On Oct 12, 2012, at 5:17 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:

 

I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.

#include "KMotionDef.h"

// Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

#define XHOME 168
#define YHOME 169
#define ZHOME 170
void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);

main()
{
persist.UserData[10] = 0;
DoHome( 1, // X
30000, // speed steps/sec
1, // direction to home
0, // home input bit
1, // bit polarity (0 or 1) when tripped
1000); // amount to move back inside (counts)

}
void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
{
float oppdir = dir * -1;

EnableAxis(axis);
if(ReadBit(bit)==polarity)
{
Jog(axis, speed * oppdir); // start moving
while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
Jog(axis,0); // stop
MoveRelAtVel(axis,sensoroffset * oppdir,speed);
while(!CheckDone(0));
}

Jog(axis, speed * dir); // start moving
//printf("%d \n",persist.UserData[10]);
while (ReadBit(bit) != polarity)
{
persist.UserData[10] = 0;

// send message to console
} // wait for switch (input #44) to change
if(ReadBit(bit)== polarity)
{
persist.UserData[10] = 1; // Signal MM that homing has completed
//printf("%d \n",persist.UserData[10]);
}
Jog(axis,0); // stop
while(!CheckDone(0));

MoveRelAtVel(axis,sensoroffset * oppdir,speed);
Zero(0);
//EnableAxisDest(axis,0);
}

Group: DynoMotion Message: 5792 From: stephen_lamarr Date: 10/12/2012
Subject: Re: Stepper Homing using Kflop andYaskawa Junma servos
TK thank you that fixed that one. But now im having the same problem with my other two axis. This is the c program.

#include "KMotionDef.h"

// Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

#define XHOME 168
#define YHOME 169
#define ZHOME 170
void DoHome(int axis, float speed, int dir, int bit, int

polarity, float sensoroffset);

main()
{
persist.UserData[12] = 0;
DoHome( 2, // XSaw
20000, // speed steps/sec
-1, // direction to

home
2, // home input bit
1, // bit polarity (0

or 1) when tripped
1000); // amount to move

back inside (counts)

}
void DoHome(int axis, float speed, int dir, int bit, int

polarity, float sensoroffset)
{
float oppdir = dir * -1;

EnableAxis(axis);
if(ReadBit(bit)==polarity)
{
Jog(axis, speed * oppdir); //

start moving
while (ReadBit(bit) == polarity) ; // wait

for switch (input #8) to change
Jog(axis,0); // stop
MoveRelAtVel(axis,sensoroffset *

oppdir,speed);
while(!CheckDone(1));
}

Jog(axis, speed * dir); // start

moving
//printf("%d \n",persist.UserData[10]);
while (ReadBit(bit) != polarity)
{
persist.UserData[12] = 0;

// send message to console
} // wait for switch (input #44) to change
if(ReadBit(bit)== polarity)
{
persist.UserData[12] = 1; // Signal MM that

homing has completed
//printf("%d \n",persist.UserData[10]);
}
Jog(axis,0); // stop
while(!CheckDone(1));

MoveRelAtVel(axis,sensoroffset * oppdir,speed);
Zero(0);
//EnableAxisDest(axis,0);
}

--- In DynoMotion@yahoogroups.com, TK <tk@...> wrote:
>
> Hi Stephen,
>
> I see some CheckDone and Zero function calls that are passing axis 0 rather than the axis variable which is 1. Try correcting those.
>
> Regards
>
> TK
>
> On Oct 12, 2012, at 5:17 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:
>
> > I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.
> >
> > #include "KMotionDef.h"
> >
> > // Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > #define XHOME 168
> > #define YHOME 169
> > #define ZHOME 170
> > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);
> >
> > main()
> > {
> > persist.UserData[10] = 0;
> > DoHome( 1, // X
> > 30000, // speed steps/sec
> > 1, // direction to home
> > 0, // home input bit
> > 1, // bit polarity (0 or 1) when tripped
> > 1000); // amount to move back inside (counts)
> >
> > }
> > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
> > {
> > float oppdir = dir * -1;
> >
> > EnableAxis(axis);
> > if(ReadBit(bit)==polarity)
> > {
> > Jog(axis, speed * oppdir); // start moving
> > while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
> > Jog(axis,0); // stop
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > while(!CheckDone(0));
> > }
> >
> > Jog(axis, speed * dir); // start moving
> > //printf("%d \n",persist.UserData[10]);
> > while (ReadBit(bit) != polarity)
> > {
> > persist.UserData[10] = 0;
> >
> > // send message to console
> > } // wait for switch (input #44) to change
> > if(ReadBit(bit)== polarity)
> > {
> > persist.UserData[10] = 1; // Signal MM that homing has completed
> > //printf("%d \n",persist.UserData[10]);
> > }
> > Jog(axis,0); // stop
> > while(!CheckDone(0));
> >
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > Zero(0);
> > //EnableAxisDest(axis,0);
> > }
> >
> >
>
Group: DynoMotion Message: 5793 From: TK Date: 10/12/2012
Subject: Re: Stepper Homing using Kflop andYaskawa Junma servos
Hi Stephen,

The variable "axis" is needed instead of a fixed number 0, 1, 2 so the function will address whatever axis is being homed. So instead of:

CheckDone(1) and Zero(0)

use

CheckDone(axis) and Zero(axis)

TK

On Oct 12, 2012, at 6:00 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:

 

TK thank you that fixed that one. But now im having the same problem with my other two axis. This is the c program.

#include "KMotionDef.h"

// Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled

#define XHOME 168
#define YHOME 169
#define ZHOME 170
void DoHome(int axis, float speed, int dir, int bit, int

polarity, float sensoroffset);

main()
{
persist.UserData[12] = 0;
DoHome( 2, // XSaw
20000, // speed steps/sec
-1, // direction to

home
2, // home input bit
1, // bit polarity (0

or 1) when tripped
1000); // amount to move

back inside (counts)

}
void DoHome(int axis, float speed, int dir, int bit, int

polarity, float sensoroffset)
{
float oppdir = dir * -1;

EnableAxis(axis);
if(ReadBit(bit)==polarity)
{
Jog(axis, speed * oppdir); //

start moving
while (ReadBit(bit) == polarity) ; // wait

for switch (input #8) to change
Jog(axis,0); // stop
MoveRelAtVel(axis,sensoroffset *

oppdir,speed);
while(!CheckDone(1));
}

Jog(axis, speed * dir); // start

moving
//printf("%d \n",persist.UserData[10]);
while (ReadBit(bit) != polarity)
{
persist.UserData[12] = 0;

// send message to console
} // wait for switch (input #44) to change
if(ReadBit(bit)== polarity)
{
persist.UserData[12] = 1; // Signal MM that

homing has completed
//printf("%d \n",persist.UserData[10]);
}
Jog(axis,0); // stop
while(!CheckDone(1));

MoveRelAtVel(axis,sensoroffset * oppdir,speed);
Zero(0);
//EnableAxisDest(axis,0);
}

--- In DynoMotion@yahoogroups.com, TK <tk@...> wrote:
>
> Hi Stephen,
>
> I see some CheckDone and Zero function calls that are passing axis 0 rather than the axis variable which is 1. Try correcting those.
>
> Regards
>
> TK
>
> On Oct 12, 2012, at 5:17 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:
>
> > I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.
> >
> > #include "KMotionDef.h"
> >
> > // Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > #define XHOME 168
> > #define YHOME 169
> > #define ZHOME 170
> > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);
> >
> > main()
> > {
> > persist.UserData[10] = 0;
> > DoHome( 1, // X
> > 30000, // speed steps/sec
> > 1, // direction to home
> > 0, // home input bit
> > 1, // bit polarity (0 or 1) when tripped
> > 1000); // amount to move back inside (counts)
> >
> > }
> > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
> > {
> > float oppdir = dir * -1;
> >
> > EnableAxis(axis);
> > if(ReadBit(bit)==polarity)
> > {
> > Jog(axis, speed * oppdir); // start moving
> > while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
> > Jog(axis,0); // stop
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > while(!CheckDone(0));
> > }
> >
> > Jog(axis, speed * dir); // start moving
> > //printf("%d \n",persist.UserData[10]);
> > while (ReadBit(bit) != polarity)
> > {
> > persist.UserData[10] = 0;
> >
> > // send message to console
> > } // wait for switch (input #44) to change
> > if(ReadBit(bit)== polarity)
> > {
> > persist.UserData[10] = 1; // Signal MM that homing has completed
> > //printf("%d \n",persist.UserData[10]);
> > }
> > Jog(axis,0); // stop
> > while(!CheckDone(0));
> >
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > Zero(0);
> > //EnableAxisDest(axis,0);
> > }
> >
> >
>

Group: DynoMotion Message: 5794 From: stephen_lamarr Date: 10/12/2012
Subject: Re: Stepper Homing using Kflop andYaskawa Junma servos
Thanks for helping out. That took care of the issue. Forgive me I'm still learning.

--- In DynoMotion@yahoogroups.com, TK <tk@...> wrote:
>
> Hi Stephen,
>
> The variable "axis" is needed instead of a fixed number 0, 1, 2 so the function will address whatever axis is being homed. So instead of:
>
> CheckDone(1) and Zero(0)
>
> use
>
> CheckDone(axis) and Zero(axis)
>
> TK
>
> On Oct 12, 2012, at 6:00 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:
>
> > TK thank you that fixed that one. But now im having the same problem with my other two axis. This is the c program.
> >
> > #include "KMotionDef.h"
> >
> > // Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > #define XHOME 168
> > #define YHOME 169
> > #define ZHOME 170
> > void DoHome(int axis, float speed, int dir, int bit, int
> >
> > polarity, float sensoroffset);
> >
> > main()
> > {
> > persist.UserData[12] = 0;
> > DoHome( 2, // XSaw
> > 20000, // speed steps/sec
> > -1, // direction to
> >
> > home
> > 2, // home input bit
> > 1, // bit polarity (0
> >
> > or 1) when tripped
> > 1000); // amount to move
> >
> > back inside (counts)
> >
> > }
> > void DoHome(int axis, float speed, int dir, int bit, int
> >
> > polarity, float sensoroffset)
> > {
> > float oppdir = dir * -1;
> >
> > EnableAxis(axis);
> > if(ReadBit(bit)==polarity)
> > {
> > Jog(axis, speed * oppdir); //
> >
> > start moving
> > while (ReadBit(bit) == polarity) ; // wait
> >
> > for switch (input #8) to change
> > Jog(axis,0); // stop
> > MoveRelAtVel(axis,sensoroffset *
> >
> > oppdir,speed);
> > while(!CheckDone(1));
> > }
> >
> > Jog(axis, speed * dir); // start
> >
> > moving
> > //printf("%d \n",persist.UserData[10]);
> > while (ReadBit(bit) != polarity)
> > {
> > persist.UserData[12] = 0;
> >
> > // send message to console
> > } // wait for switch (input #44) to change
> > if(ReadBit(bit)== polarity)
> > {
> > persist.UserData[12] = 1; // Signal MM that
> >
> > homing has completed
> > //printf("%d \n",persist.UserData[10]);
> > }
> > Jog(axis,0); // stop
> > while(!CheckDone(1));
> >
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > Zero(0);
> > //EnableAxisDest(axis,0);
> > }
> >
> > --- In DynoMotion@yahoogroups.com, TK <tk@> wrote:
> > >
> > > Hi Stephen,
> > >
> > > I see some CheckDone and Zero function calls that are passing axis 0 rather than the axis variable which is 1. Try correcting those.
> > >
> > > Regards
> > >
> > > TK
> > >
> > > On Oct 12, 2012, at 5:17 PM, "stephen_lamarr" <stephen_lamarr@> wrote:
> > >
> > > > I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Homing program for a 3 axis System
> > > > // Limit switches are disabled and used as a home switch
> > > > // then they are re-enabled
> > > >
> > > > #define XHOME 168
> > > > #define YHOME 169
> > > > #define ZHOME 170
> > > > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);
> > > >
> > > > main()
> > > > {
> > > > persist.UserData[10] = 0;
> > > > DoHome( 1, // X
> > > > 30000, // speed steps/sec
> > > > 1, // direction to home
> > > > 0, // home input bit
> > > > 1, // bit polarity (0 or 1) when tripped
> > > > 1000); // amount to move back inside (counts)
> > > >
> > > > }
> > > > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
> > > > {
> > > > float oppdir = dir * -1;
> > > >
> > > > EnableAxis(axis);
> > > > if(ReadBit(bit)==polarity)
> > > > {
> > > > Jog(axis, speed * oppdir); // start moving
> > > > while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
> > > > Jog(axis,0); // stop
> > > > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > > > while(!CheckDone(0));
> > > > }
> > > >
> > > > Jog(axis, speed * dir); // start moving
> > > > //printf("%d \n",persist.UserData[10]);
> > > > while (ReadBit(bit) != polarity)
> > > > {
> > > > persist.UserData[10] = 0;
> > > >
> > > > // send message to console
> > > > } // wait for switch (input #44) to change
> > > > if(ReadBit(bit)== polarity)
> > > > {
> > > > persist.UserData[10] = 1; // Signal MM that homing has completed
> > > > //printf("%d \n",persist.UserData[10]);
> > > > }
> > > > Jog(axis,0); // stop
> > > > while(!CheckDone(0));
> > > >
> > > > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > > > Zero(0);
> > > > //EnableAxisDest(axis,0);
> > > > }
> > > >
> > > >
> > >
> >
> >
>
Group: DynoMotion Message: 5796 From: brad murry Date: 10/13/2012
Subject: Re: Stepper Homing using Kflop andYaskawa Junma servos
Awesome job Steve, +50 bonus points!

Its likely somebody got copy pasty with the original home routines and started hard coding axis channels. Now I think you see more of what is going on and will be able to find problems like it in the future.


-Brad Murry

From: stephen_lamarr
Sent: 10/12/2012 6:53 PM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] Re: Stepper Homing using Kflop andYaskawa Junma servos

 

Thanks for helping out. That took care of the issue. Forgive me I'm still learning.

--- In DynoMotion@yahoogroups.com, TK <tk@...> wrote:
>
> Hi Stephen,
>
> The variable "axis" is needed instead of a fixed number 0, 1, 2 so the function will address whatever axis is being homed. So instead of:
>
> CheckDone(1) and Zero(0)
>
> use
>
> CheckDone(axis) and Zero(axis)
>
> TK
>
> On Oct 12, 2012, at 6:00 PM, "stephen_lamarr" <stephen_lamarr@...> wrote:
>
> > TK thank you that fixed that one. But now im having the same problem with my other two axis. This is the c program.
> >
> > #include "KMotionDef.h"
> >
> > // Homing program for a 3 axis System
> > // Limit switches are disabled and used as a home switch
> > // then they are re-enabled
> >
> > #define XHOME 168
> > #define YHOME 169
> > #define ZHOME 170
> > void DoHome(int axis, float speed, int dir, int bit, int
> >
> > polarity, float sensoroffset);
> >
> > main()
> > {
> > persist.UserData[12] = 0;
> > DoHome( 2, // XSaw
> > 20000, // speed steps/sec
> > -1, // direction to
> >
> > home
> > 2, // home input bit
> > 1, // bit polarity (0
> >
> > or 1) when tripped
> > 1000); // amount to move
> >
> > back inside (counts)
> >
> > }
> > void DoHome(int axis, float speed, int dir, int bit, int
> >
> > polarity, float sensoroffset)
> > {
> > float oppdir = dir * -1;
> >
> > EnableAxis(axis);
> > if(ReadBit(bit)==polarity)
> > {
> > Jog(axis, speed * oppdir); //
> >
> > start moving
> > while (ReadBit(bit) == polarity) ; // wait
> >
> > for switch (input #8) to change
> > Jog(axis,0); // stop
> > MoveRelAtVel(axis,sensoroffset *
> >
> > oppdir,speed);
> > while(!CheckDone(1));
> > }
> >
> > Jog(axis, speed * dir); // start
> >
> > moving
> > //printf("%d \n",persist.UserData[10]);
> > while (ReadBit(bit) != polarity)
> > {
> > persist.UserData[12] = 0;
> >
> > // send message to console
> > } // wait for switch (input #44) to change
> > if(ReadBit(bit)== polarity)
> > {
> > persist.UserData[12] = 1; // Signal MM that
> >
> > homing has completed
> > //printf("%d \n",persist.UserData[10]);
> > }
> > Jog(axis,0); // stop
> > while(!CheckDone(1));
> >
> > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > Zero(0);
> > //EnableAxisDest(axis,0);
> > }
> >
> > --- In DynoMotion@yahoogroups.com, TK <tk@> wrote:
> > >
> > > Hi Stephen,
> > >
> > > I see some CheckDone and Zero function calls that are passing axis 0 rather than the axis variable which is 1. Try correcting those.
> > >
> > > Regards
> > >
> > > TK
> > >
> > > On Oct 12, 2012, at 5:17 PM, "stephen_lamarr" <stephen_lamarr@> wrote:
> > >
> > > > I am having problems with my homing sequence. If I am off my home sensor and home everything is fine. I end up in homed position with my home sensor flagged. If I home again after homing, the machine should come off the sensor then index back to the sensor. This is not always happening. Most of the time it will come off the sensor and not index back to the sensor. It is inconsistant. Doesn't always come off the sensor then index back like it should. Below is a copy of the c program I am using for homing. Please help.
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > // Homing program for a 3 axis System
> > > > // Limit switches are disabled and used as a home switch
> > > > // then they are re-enabled
> > > >
> > > > #define XHOME 168
> > > > #define YHOME 169
> > > > #define ZHOME 170
> > > > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset);
> > > >
> > > > main()
> > > > {
> > > > persist.UserData[10] = 0;
> > > > DoHome( 1, // X
> > > > 30000, // speed steps/sec
> > > > 1, // direction to home
> > > > 0, // home input bit
> > > > 1, // bit polarity (0 or 1) when tripped
> > > > 1000); // amount to move back inside (counts)
> > > >
> > > > }
> > > > void DoHome(int axis, float speed, int dir, int bit, int polarity, float sensoroffset)
> > > > {
> > > > float oppdir = dir * -1;
> > > >
> > > > EnableAxis(axis);
> > > > if(ReadBit(bit)==polarity)
> > > > {
> > > > Jog(axis, speed * oppdir); // start moving
> > > > while (ReadBit(bit) == polarity) ; // wait for switch (input #8) to change
> > > > Jog(axis,0); // stop
> > > > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > > > while(!CheckDone(0));
> > > > }
> > > >
> > > > Jog(axis, speed * dir); // start moving
> > > > //printf("%d \n",persist.UserData[10]);
> > > > while (ReadBit(bit) != polarity)
> > > > {
> > > > persist.UserData[10] = 0;
> > > >
> > > > // send message to console
> > > > } // wait for switch (input #44) to change
> > > > if(ReadBit(bit)== polarity)
> > > > {
> > > > persist.UserData[10] = 1; // Signal MM that homing has completed
> > > > //printf("%d \n",persist.UserData[10]);
> > > > }
> > > > Jog(axis,0); // stop
> > > > while(!CheckDone(0));
> > > >
> > > > MoveRelAtVel(axis,sensoroffset * oppdir,speed);
> > > > Zero(0);
> > > > //EnableAxisDest(axis,0);
> > > > }
> > > >
> > > >
> > >
> >
> >
>